All Questions
89 questions
2votes
1answer
243views
How to find files of a certain minimum size?
With find, I will check if any file(s) with a minimum size of 1 byte exists in the directory in, and if not then exit. I tried something like this, but it does not work find ./in/ -type f -iname '*' -...
0votes
1answer
88views
Why does find ....-execdir rename miss files? zsh
I'm using zsh on MX Linux 23.2. For years I have tried to figure out why a command like find . -depth -type f -execdir rename 's/_720p//' {} \; skips over files. I know my file manager can't be ...
1vote
1answer
436views
How to list matching files to a glob pattern?
I've read, and tried, various answers to a question similar to this but they don't work (or at least I can't get them to) for my particular use case. I have a CI build pipeline that allows a glob ...
0votes
0answers
52views
Move directory contents up one level only if it contains files
How to I move directory contects up one level only if it contains files. Some hints would help. Thanks! Example to move up one level: ├── AAA │ └── AAA1 │ ├── 001.jpg │ ├── 002.jpg │ ...
1vote
1answer
138views
How to move a set of files and directories, excluding another (sub-)set
I have two bash arrays, one of them (named toMove) contains paths to files and directories to move (not copy) somewhere else, and the other one (named exclude) contains paths to files and directories ...
0votes
1answer
244views
Script for copy bookmarks from one pdf to another
I want to transfer bookmarks from a series of uncompressed pdf files to their compressed copies (these copies do not have the original bookmarks). I know how to do this one by one using pdftk. First I ...
-2votes
2answers
173views
find larger files under /tmp (owned by oracle user, size larger than 1 MiB) and truncate them
My requirement is to find files under /tmp owned by the oracle user, with size larger than 1 MiB then truncate those files (empty them). Can someone please help me with this?
1vote
0answers
40views
Select one out of 2 specific files, copy and rename it
I need help running code locally using a terminal app called NewTerm2 on my iPhone (this app has limited functionality but it's more comfortable with unix commands) Here's the case: I have this tree /...
1vote
0answers
700views
I have a text file with a list of files I need copied how do I do this?
I have a text file that has a list of files with each file name on a new line. Those files exist in multiple subfolders. I need to copy those files to a separate folder where all of the files that I'm ...
6votes
6answers
640views
List only sub-directories containing two specific files
I'm running the following code on iOS using my iPhone's terminal, to be clear, this command is run within my jailbroken iphone using a slim terminal tweak called New Term 2: cd /var/mobile/Library/...
1vote
2answers
332views
Finding a string in a txt of house addresses with number ranges by passing in exact number and street names
Context I'm a postal worker (mail sorter) and am trying to write a bash script which allows me to input an exact street address and first couple letters of a street name, and have it return the ...
0votes
2answers
4kviews
"find: paths must precede expression:" error only when run in a script
If I do my find command at the command line, it works fine, but if I try it in a script, I get this error. I run the command like FILTER=" | grep -v \"test\"" files=`find . -type f ...
1vote
1answer
2kviews
Readable format of file sizes using the Find command
To see human readable output, I can use the following command – du command -h option : Display sizes in human readable format (e.g., 1K, 234M, 2G). $ du -hsx * | sort -rh | head -10 The sample output ...
0votes
1answer
289views
Find, zip and remove in a single line with a condition
I'm trying to simplifly a script into a single line which can find recursively files created yesterday, zip, move and remove depending of a condition. I have this structure: ../main -> child1 (...
0votes
1answer
242views
Using find with sh command not working - further queries
Further to the earlier query posted Using find with sh - command not working find . -type f -name '*FW*' -exec grep -iEq 'chmod.*archive|archive.*chmod' {} \; -ls This cmd was not able to find the ...